//
//  CTPMessage.m
//  LittleNotes
//
//  Created by 檀志文 on 16/5/19.
//  Copyright © 2016年 ios檀志文. All rights reserved.
//

#import "CTPMessage.h"

@implementation CTPMessage

/// 字典转模型
+ (instancetype)msgsWithDict:(NSDictionary *)dict{
        id obj = [[self alloc] init];
        [obj setValuesForKeysWithDictionary:dict];
        return obj;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{}
//}
-(NSString *)description{
    return [NSString stringWithFormat:@"Id: %zd, titleId:%zd, content: %@, created_at: %@, pic_urls: %@", self.Id,self.titleId, self.content, self.created_at, self.pic_urls];
}


- (instancetype)initWithTitleId:(NSInteger)titleId content:(NSString *)content created_at:(NSString *)created_at pic_urls:(NSString *)pic_urls{
    if (self =[super init]) {
        [self setValue:[NSString stringWithFormat:@"%ld",titleId] forKey:@"titleId"];
        [self setValue:content forKey:@"content"];
        [self setValue:created_at forKey:@"created_at"];
        [self setValue:pic_urls forKey:@"pic_urls"];
    }
    return self;
}

@end
